/*
 * Copyright (c) 2011, Brookhaven National Laboratory
 * All rights reserved.
 * The software in this package is published under the terms
 * of the BSD license a copy of which has been included with
 * this distribution in the license.txt file.
 */

#include "oxtypes/DynamicTypeFinder.h"

#include <tdds/xtypes/DynamicType.hpp>
#include "dds/type/dynamic/detail/DynamicType.h"
#include "oxtypes/delegate/DynamicType.h"

#include "oxtypes/impl/DynamicTypeManagerImpl.h"

using dds::type::dynamic::DynamicType;

oxtypes::impl::DynamicTypeManagerImpl* tregistry_ = 0;

namespace oxtypes {

DynamicTypeFinder* DynamicTypeFinder::singleton = 0;

DynamicTypeFinder* DynamicTypeFinder::getInstance(){
  if(singleton == 0) {
    singleton = new DynamicTypeFinder();
  }
  return singleton;
}

DynamicTypeFinder::DynamicTypeFinder(){
  tregistry_ = oxtypes::impl::DynamicTypeManagerImpl::getInstance();  
}

DynamicType DynamicTypeFinder::getType(const std::string& typeName){
  return tregistry_->getType(typeName);
}


}
